package com.android.nextBus.DB;


//this class provides table schema for a table in the our db
//a  table in our DB can have text columns, integer columns, and foreign key columnss (foreign key columnss must also be integer columsn)
//every table automatically has a primary key column with the name "_ID"  - this primary key column name is not included in this class
public class SqliteTable {
	
	//store the table name
	private String tableName;
	
	//string array to store the column names of all text columns in the table
	private String[]  tableTextColumnNames;

	//string array to store the column names of all integer columns in the table
	private String[]  tableIntegerColumnNamesArray;

	//string array to store the column names of all foreign key columns in the table
	//note: foreign key columns must also be integer columns, so you must
	//have the column name for a foreign key column in both the array for integer column names (tableIntegerColumnNamesArray)
	//and this array 
	private String[]  tableFkColumnNamesArray;

	//string array to store the table names of the tables referenced by the foreign keys in the string array "tableFkColumnNamesArray"
	//note: the order of the table name references must correspond to the order of the elements in the string array "tableFkColumnNamesArray"
	//Each entry in the "in the string array "tableFkColumnNamesArray" must be the table name that is referenced by the first foreign key column in 
	// the "tableFkColumnNamesArray" array.
	private String[]  tableFkReferencesTableArray;

	//constructor takes string arrays that describe the table schema
	public SqliteTable(String table_name,
			String[]  table_text_column_names,
			String[]  table_integer_column_names_array,
			String[]  table_fk_column_names_array,
			String[]  table_fk_references_table_array)
	{
		
		tableName = table_name;
		
		tableTextColumnNames = table_text_column_names;
		tableIntegerColumnNamesArray = table_integer_column_names_array;
		tableFkColumnNamesArray = table_fk_column_names_array;
		tableFkReferencesTableArray = table_fk_references_table_array;
		
	}

	/**
	 * @return the tableName
	 */
	public String getTableName() {
		return tableName;
	}

	/**
	 * @return the tableTextColumnNames
	 */
	public String[] getTableTextColumnNames() {
		return tableTextColumnNames.clone();
	}

	/**
	 * @return the tableIntegerColumnNamesArray
	 */
	public String[] getTableIntegerColumnNamesArray() {
		return tableIntegerColumnNamesArray.clone();
	}

	/**
	 * @return the tableFkColumnNamesArray
	 */
	public String[] getTableFkColumnNamesArray() {
		return tableFkColumnNamesArray.clone();
	}

	/**
	 * @return the tableFkReferencesTableArray
	 */
	public String[] getTableFkReferencesTableArray() {
		return tableFkReferencesTableArray.clone();
	}


}
